;--------------------------------------------------------
; File Created by SDCC : free open source ANSI-C Compiler
; Version 3.3.0 #8604 (May 11 2013) (Linux)
; This file was generated Thu Jun 20 19:56:43 2013
;--------------------------------------------------------
; PIC16 port for the Microchip 16-bit core micros
;--------------------------------------------------------

	.ident "SDCC version 3.3.0 #8604 [pic16 port]"
	.file	"lcdTest.c"
	list	p=18f2550
	radix	dec
	CONFIG	PLLDIV=5,CPUDIV=OSC1_PLL2,USBDIV=2
	CONFIG	FOSC=HSPLL_HS,FCMEN=ON,IESO=ON
	CONFIG	PWRT=ON,BOR=ON,BORV=0,VREGEN=OFF


;--------------------------------------------------------
; public variables in this module
;--------------------------------------------------------
	global	_lcd_send_quartet
	global	_lcd_send
	global	_lcd_init
	global	_lcd_gotoxy
	global	_lcd_putc
	global	_lcd_setcursor_vb
	global	_lcd_puts
	global	_lcd_hexa
	global	_delay_cycles
	global	_delay_us
	global	_delay_ms
	global	_main
	global	_LCD_INIT_STRING

;--------------------------------------------------------
; extern variables in this module
;--------------------------------------------------------
	extern	__gptrget1
	extern	_UFRMLbits
	extern	_UFRMHbits
	extern	_UIRbits
	extern	_UIEbits
	extern	_UEIRbits
	extern	_UEIEbits
	extern	_USTATbits
	extern	_UCONbits
	extern	_UADDRbits
	extern	_UCFGbits
	extern	_UEP0bits
	extern	_UEP1bits
	extern	_UEP2bits
	extern	_UEP3bits
	extern	_UEP4bits
	extern	_UEP5bits
	extern	_UEP6bits
	extern	_UEP7bits
	extern	_UEP8bits
	extern	_UEP9bits
	extern	_UEP10bits
	extern	_UEP11bits
	extern	_UEP12bits
	extern	_UEP13bits
	extern	_UEP14bits
	extern	_UEP15bits
	extern	_PORTAbits
	extern	_PORTBbits
	extern	_PORTCbits
	extern	_PORTEbits
	extern	_LATAbits
	extern	_LATBbits
	extern	_LATCbits
	extern	_DDRAbits
	extern	_TRISAbits
	extern	_DDRBbits
	extern	_TRISBbits
	extern	_DDRCbits
	extern	_TRISCbits
	extern	_OSCTUNEbits
	extern	_PIE1bits
	extern	_PIR1bits
	extern	_IPR1bits
	extern	_PIE2bits
	extern	_PIR2bits
	extern	_IPR2bits
	extern	_EECON1bits
	extern	_RCSTAbits
	extern	_TXSTAbits
	extern	_T3CONbits
	extern	_CMCONbits
	extern	_CVRCONbits
	extern	_CCP1ASbits
	extern	_ECCP1ASbits
	extern	_CCP1DELbits
	extern	_ECCP1DELbits
	extern	_BAUDCONbits
	extern	_BAUDCTLbits
	extern	_CCP2CONbits
	extern	_CCP1CONbits
	extern	_ADCON2bits
	extern	_ADCON1bits
	extern	_ADCON0bits
	extern	_SSPCON2bits
	extern	_SSPCON1bits
	extern	_SSPSTATbits
	extern	_T2CONbits
	extern	_T1CONbits
	extern	_RCONbits
	extern	_WDTCONbits
	extern	_HLVDCONbits
	extern	_LVDCONbits
	extern	_OSCCONbits
	extern	_T0CONbits
	extern	_STATUSbits
	extern	_INTCON3bits
	extern	_INTCON2bits
	extern	_INTCONbits
	extern	_STKPTRbits
	extern	_UFRM
	extern	_UFRML
	extern	_UFRMH
	extern	_UIR
	extern	_UIE
	extern	_UEIR
	extern	_UEIE
	extern	_USTAT
	extern	_UCON
	extern	_UADDR
	extern	_UCFG
	extern	_UEP0
	extern	_UEP1
	extern	_UEP2
	extern	_UEP3
	extern	_UEP4
	extern	_UEP5
	extern	_UEP6
	extern	_UEP7
	extern	_UEP8
	extern	_UEP9
	extern	_UEP10
	extern	_UEP11
	extern	_UEP12
	extern	_UEP13
	extern	_UEP14
	extern	_UEP15
	extern	_PORTA
	extern	_PORTB
	extern	_PORTC
	extern	_PORTE
	extern	_LATA
	extern	_LATB
	extern	_LATC
	extern	_DDRA
	extern	_TRISA
	extern	_DDRB
	extern	_TRISB
	extern	_DDRC
	extern	_TRISC
	extern	_OSCTUNE
	extern	_PIE1
	extern	_PIR1
	extern	_IPR1
	extern	_PIE2
	extern	_PIR2
	extern	_IPR2
	extern	_EECON1
	extern	_EECON2
	extern	_EEDATA
	extern	_EEADR
	extern	_RCSTA
	extern	_TXSTA
	extern	_TXREG
	extern	_RCREG
	extern	_SPBRG
	extern	_SPBRGH
	extern	_T3CON
	extern	_TMR3
	extern	_TMR3L
	extern	_TMR3H
	extern	_CMCON
	extern	_CVRCON
	extern	_CCP1AS
	extern	_ECCP1AS
	extern	_CCP1DEL
	extern	_ECCP1DEL
	extern	_BAUDCON
	extern	_BAUDCTL
	extern	_CCP2CON
	extern	_CCPR2
	extern	_CCPR2L
	extern	_CCPR2H
	extern	_CCP1CON
	extern	_CCPR1
	extern	_CCPR1L
	extern	_CCPR1H
	extern	_ADCON2
	extern	_ADCON1
	extern	_ADCON0
	extern	_ADRES
	extern	_ADRESL
	extern	_ADRESH
	extern	_SSPCON2
	extern	_SSPCON1
	extern	_SSPSTAT
	extern	_SSPADD
	extern	_SSPBUF
	extern	_T2CON
	extern	_PR2
	extern	_TMR2
	extern	_T1CON
	extern	_TMR1
	extern	_TMR1L
	extern	_TMR1H
	extern	_RCON
	extern	_WDTCON
	extern	_HLVDCON
	extern	_LVDCON
	extern	_OSCCON
	extern	_T0CON
	extern	_TMR0
	extern	_TMR0L
	extern	_TMR0H
	extern	_STATUS
	extern	_FSR2L
	extern	_FSR2H
	extern	_PLUSW2
	extern	_PREINC2
	extern	_POSTDEC2
	extern	_POSTINC2
	extern	_INDF2
	extern	_BSR
	extern	_FSR1L
	extern	_FSR1H
	extern	_PLUSW1
	extern	_PREINC1
	extern	_POSTDEC1
	extern	_POSTINC1
	extern	_INDF1
	extern	_WREG
	extern	_FSR0L
	extern	_FSR0H
	extern	_PLUSW0
	extern	_PREINC0
	extern	_POSTDEC0
	extern	_POSTINC0
	extern	_INDF0
	extern	_INTCON3
	extern	_INTCON2
	extern	_INTCON
	extern	_PROD
	extern	_PRODL
	extern	_PRODH
	extern	_TABLAT
	extern	_TBLPTR
	extern	_TBLPTRL
	extern	_TBLPTRH
	extern	_TBLPTRU
	extern	_PC
	extern	_PCL
	extern	_PCLATH
	extern	_PCLATU
	extern	_STKPTR
	extern	_TOS
	extern	_TOSL
	extern	_TOSH
	extern	_TOSU
	extern	_delay10tcy
	extern	_delay1ktcy

;--------------------------------------------------------
;	Equates to used internal registers
;--------------------------------------------------------
STATUS	equ	0xfd8
PCL	equ	0xff9
PCLATH	equ	0xffa
PCLATU	equ	0xffb
WREG	equ	0xfe8
TBLPTRL	equ	0xff6
TBLPTRH	equ	0xff7
TBLPTRU	equ	0xff8
TABLAT	equ	0xff5
FSR0L	equ	0xfe9
FSR1L	equ	0xfe1
FSR2L	equ	0xfd9
POSTINC1	equ	0xfe6
POSTDEC1	equ	0xfe5
PREINC1	equ	0xfe4
PLUSW2	equ	0xfdb
PRODL	equ	0xff3
PRODH	equ	0xff4


; Internal registers
.registers	udata_ovr	0x0000
r0x00	res	1
r0x01	res	1
r0x02	res	1
r0x03	res	1
r0x04	res	1

;--------------------------------------------------------
; interrupt vector
;--------------------------------------------------------

;--------------------------------------------------------
; global & static initialisations
;--------------------------------------------------------
; I code from now on!
; ; Starting pCode block
S_lcdTest__main	code
_main:
	.line	31; lcdTest.c	delay_ms(500);
	MOVLW	0x01
	MOVWF	POSTDEC1
	MOVLW	0xf4
	MOVWF	POSTDEC1
	CALL	_delay_ms
	MOVF	POSTINC1, F
	MOVF	POSTINC1, F
	.line	32; lcdTest.c	delay_ms(500);
	MOVLW	0x01
	MOVWF	POSTDEC1
	MOVLW	0xf4
	MOVWF	POSTDEC1
	CALL	_delay_ms
	MOVF	POSTINC1, F
	MOVF	POSTINC1, F
	.line	33; lcdTest.c	lcd_init();
	CALL	_lcd_init
	.line	34; lcdTest.c	lcd_send(LCD_COMMANDMODE, LCD_CLEAR);
	MOVLW	0x01
	MOVWF	POSTDEC1
	MOVLW	0x00
	MOVWF	POSTDEC1
	CALL	_lcd_send
	MOVF	POSTINC1, F
	MOVF	POSTINC1, F
	.line	35; lcdTest.c	lcd_send(LCD_COMMANDMODE, LCD_LINE1);
	MOVLW	0x80
	MOVWF	POSTDEC1
	MOVLW	0x00
	MOVWF	POSTDEC1
	CALL	_lcd_send
	MOVF	POSTINC1, F
	MOVF	POSTINC1, F
	.line	36; lcdTest.c	lcd_puts("  Automatismo para  ");
	MOVLW	UPPER(__str_0)
	MOVWF	r0x02
	MOVLW	HIGH(__str_0)
	MOVWF	r0x01
	MOVLW	LOW(__str_0)
	MOVWF	r0x00
	MOVF	r0x02, W
	MOVWF	POSTDEC1
	MOVF	r0x01, W
	MOVWF	POSTDEC1
	MOVF	r0x00, W
	MOVWF	POSTDEC1
	CALL	_lcd_puts
	MOVLW	0x03
	ADDWF	FSR1L, F
	.line	37; lcdTest.c	lcd_send(LCD_COMMANDMODE, LCD_LINE2);
	MOVLW	0xc0
	MOVWF	POSTDEC1
	MOVLW	0x00
	MOVWF	POSTDEC1
	CALL	_lcd_send
	MOVF	POSTINC1, F
	MOVF	POSTINC1, F
	.line	38; lcdTest.c	lcd_puts("   medicion en inv. ");
	MOVLW	UPPER(__str_1)
	MOVWF	r0x02
	MOVLW	HIGH(__str_1)
	MOVWF	r0x01
	MOVLW	LOW(__str_1)
	MOVWF	r0x00
	MOVF	r0x02, W
	MOVWF	POSTDEC1
	MOVF	r0x01, W
	MOVWF	POSTDEC1
	MOVF	r0x00, W
	MOVWF	POSTDEC1
	CALL	_lcd_puts
	MOVLW	0x03
	ADDWF	FSR1L, F
	.line	39; lcdTest.c	lcd_send(LCD_COMMANDMODE, LCD_LINE3);
	MOVLW	0x94
	MOVWF	POSTDEC1
	MOVLW	0x00
	MOVWF	POSTDEC1
	CALL	_lcd_send
	MOVF	POSTINC1, F
	MOVF	POSTINC1, F
	.line	40; lcdTest.c	lcd_puts("   paleo-ambiental .");
	MOVLW	UPPER(__str_2)
	MOVWF	r0x02
	MOVLW	HIGH(__str_2)
	MOVWF	r0x01
	MOVLW	LOW(__str_2)
	MOVWF	r0x00
	MOVF	r0x02, W
	MOVWF	POSTDEC1
	MOVF	r0x01, W
	MOVWF	POSTDEC1
	MOVF	r0x00, W
	MOVWF	POSTDEC1
	CALL	_lcd_puts
	MOVLW	0x03
	ADDWF	FSR1L, F
	.line	41; lcdTest.c	lcd_send(LCD_COMMANDMODE, LCD_LINE4);
	MOVLW	0xd4
	MOVWF	POSTDEC1
	MOVLW	0x00
	MOVWF	POSTDEC1
	CALL	_lcd_send
	MOVF	POSTINC1, F
	MOVF	POSTINC1, F
	.line	42; lcdTest.c	lcd_puts("   IGL UNAM - ITST  ");
	MOVLW	UPPER(__str_3)
	MOVWF	r0x02
	MOVLW	HIGH(__str_3)
	MOVWF	r0x01
	MOVLW	LOW(__str_3)
	MOVWF	r0x00
	MOVF	r0x02, W
	MOVWF	POSTDEC1
	MOVF	r0x01, W
	MOVWF	POSTDEC1
	MOVF	r0x00, W
	MOVWF	POSTDEC1
	CALL	_lcd_puts
	MOVLW	0x03
	ADDWF	FSR1L, F
	.line	43; lcdTest.c	delay_ms(1000);
	MOVLW	0x03
	MOVWF	POSTDEC1
	MOVLW	0xe8
	MOVWF	POSTDEC1
	CALL	_delay_ms
	MOVF	POSTINC1, F
	MOVF	POSTINC1, F
	.line	44; lcdTest.c	delay_ms(1000);
	MOVLW	0x03
	MOVWF	POSTDEC1
	MOVLW	0xe8
	MOVWF	POSTDEC1
	CALL	_delay_ms
	MOVF	POSTINC1, F
	MOVF	POSTINC1, F
	RETURN	

; ; Starting pCode block
S_lcdTest__lcd_hexa	code
_lcd_hexa:
	.line	357; fLCD3bSDCC.h	char lcd_hexa(char a)
	MOVFF	FSR2L, POSTDEC1
	MOVFF	FSR1L, FSR2L
	MOVFF	r0x00, POSTDEC1
	MOVLW	0x02
	MOVFF	PLUSW2, r0x00
	.line	359; fLCD3bSDCC.h	if(a > 9)
	MOVF	r0x00, W
	ADDLW	0x80
	ADDLW	0x76
	BNC	_00292_DS_
	.line	360; fLCD3bSDCC.h	a+= 55;
	MOVLW	0x37
	ADDWF	r0x00, F
	BRA	_00293_DS_
_00292_DS_:
	.line	362; fLCD3bSDCC.h	a+= 48;
	MOVLW	0x30
	ADDWF	r0x00, F
_00293_DS_:
	.line	363; fLCD3bSDCC.h	return a;
	MOVF	r0x00, W
	MOVFF	PREINC1, r0x00
	MOVFF	PREINC1, FSR2L
	RETURN	

; ; Starting pCode block
S_lcdTest__lcd_puts	code
_lcd_puts:
	.line	348; fLCD3bSDCC.h	void lcd_puts(char * ptr)
	MOVFF	FSR2L, POSTDEC1
	MOVFF	FSR1L, FSR2L
	MOVFF	r0x00, POSTDEC1
	MOVFF	r0x01, POSTDEC1
	MOVFF	r0x02, POSTDEC1
	MOVFF	r0x03, POSTDEC1
	MOVLW	0x02
	MOVFF	PLUSW2, r0x00
	MOVLW	0x03
	MOVFF	PLUSW2, r0x01
	MOVLW	0x04
	MOVFF	PLUSW2, r0x02
_00274_DS_:
	.line	350; fLCD3bSDCC.h	while(*ptr)
	MOVFF	r0x00, FSR0L
	MOVFF	r0x01, PRODL
	MOVF	r0x02, W
	CALL	__gptrget1
	MOVWF	r0x03
	MOVF	r0x03, W
	BZ	_00277_DS_
	.line	352; fLCD3bSDCC.h	lcd_putc(*ptr);
	MOVF	r0x03, W
	MOVWF	POSTDEC1
	CALL	_lcd_putc
	MOVF	POSTINC1, F
	.line	353; fLCD3bSDCC.h	ptr++;
	INCF	r0x00, F
	BNC	_00274_DS_
	INFSNZ	r0x01, F
	INCF	r0x02, F
_00286_DS_:
	BRA	_00274_DS_
_00277_DS_:
	MOVFF	PREINC1, r0x03
	MOVFF	PREINC1, r0x02
	MOVFF	PREINC1, r0x01
	MOVFF	PREINC1, r0x00
	MOVFF	PREINC1, FSR2L
	RETURN	

; ; Starting pCode block
S_lcdTest__lcd_setcursor_vb	code
_lcd_setcursor_vb:
	.line	337; fLCD3bSDCC.h	void lcd_setcursor_vb(unsigned char visible, unsigned char blink)
	MOVFF	FSR2L, POSTDEC1
	MOVFF	FSR1L, FSR2L
	MOVFF	r0x00, POSTDEC1
	MOVFF	r0x01, POSTDEC1
	MOVFF	r0x02, POSTDEC1
	MOVLW	0x02
	MOVFF	PLUSW2, r0x00
	MOVLW	0x03
	MOVFF	PLUSW2, r0x01
	.line	339; fLCD3bSDCC.h	lcd_send(LCD_COMMANDMODE, LCD_DIS_ON | (visible << 1) | blink);
	RLNCF	r0x00, W
	ANDLW	0xfe
	MOVWF	r0x02
	MOVLW	0x0c
	IORWF	r0x02, W
	MOVWF	r0x00
	MOVF	r0x00, W
	IORWF	r0x01, F
	MOVF	r0x01, W
	MOVWF	POSTDEC1
	MOVLW	0x00
	MOVWF	POSTDEC1
	CALL	_lcd_send
	MOVF	POSTINC1, F
	MOVF	POSTINC1, F
	MOVFF	PREINC1, r0x02
	MOVFF	PREINC1, r0x01
	MOVFF	PREINC1, r0x00
	MOVFF	PREINC1, FSR2L
	RETURN	

; ; Starting pCode block
S_lcdTest__lcd_putc	code
_lcd_putc:
	.line	305; fLCD3bSDCC.h	void lcd_putc( char c)
	MOVFF	FSR2L, POSTDEC1
	MOVFF	FSR1L, FSR2L
	MOVFF	r0x00, POSTDEC1
	MOVLW	0x02
	MOVFF	PLUSW2, r0x00
	.line	308; fLCD3bSDCC.h	if(c == 'ñ') c= 0xee;//ñ
	MOVF	r0x00, W
	XORLW	0xc3
	BNZ	_00230_DS_
	MOVLW	0xee
	MOVWF	r0x00
_00230_DS_:
	.line	309; fLCD3bSDCC.h	if(c == 'º') c=0xdf;//º
	MOVF	r0x00, W
	XORLW	0xc2
	BNZ	_00232_DS_
	MOVLW	0xdf
	MOVWF	r0x00
_00232_DS_:
	.line	310; fLCD3bSDCC.h	switch(c)
	MOVF	r0x00, W
	XORLW	0x08
	BZ	_00235_DS_
	MOVF	r0x00, W
	XORLW	0x0a
	BZ	_00234_DS_
	MOVF	r0x00, W
	XORLW	0x0c
	BNZ	_00236_DS_
	.line	314; fLCD3bSDCC.h	lcd_send(LCD_COMMANDMODE, LCD_CLEAR);
	MOVLW	0x01
	MOVWF	POSTDEC1
	MOVLW	0x00
	MOVWF	POSTDEC1
	CALL	_lcd_send
	MOVF	POSTINC1, F
	MOVF	POSTINC1, F
	.line	315; fLCD3bSDCC.h	break;
	BRA	_00238_DS_
_00234_DS_:
	.line	317; fLCD3bSDCC.h	lcd_gotoxy(1,++lcd_line);
	MOVLW	0x02
	MOVWF	POSTDEC1
	MOVLW	0x01
	MOVWF	POSTDEC1
	CALL	_lcd_gotoxy
	MOVF	POSTINC1, F
	MOVF	POSTINC1, F
	.line	318; fLCD3bSDCC.h	break;
	BRA	_00238_DS_
_00235_DS_:
	.line	320; fLCD3bSDCC.h	lcd_send(LCD_COMMANDMODE, LCD_CURSOR_IZQ);
	MOVLW	0x10
	MOVWF	POSTDEC1
	MOVLW	0x00
	MOVWF	POSTDEC1
	CALL	_lcd_send
	MOVF	POSTINC1, F
	MOVF	POSTINC1, F
	.line	321; fLCD3bSDCC.h	break;
	BRA	_00238_DS_
_00236_DS_:
	.line	323; fLCD3bSDCC.h	lcd_send(LCD_CHARMODE,c);
	MOVF	r0x00, W
	MOVWF	POSTDEC1
	MOVLW	0x01
	MOVWF	POSTDEC1
	CALL	_lcd_send
	MOVF	POSTINC1, F
	MOVF	POSTINC1, F
_00238_DS_:
	.line	325; fLCD3bSDCC.h	}
	MOVFF	PREINC1, r0x00
	MOVFF	PREINC1, FSR2L
	RETURN	

; ; Starting pCode block
S_lcdTest__lcd_gotoxy	code
_lcd_gotoxy:
	.line	270; fLCD3bSDCC.h	void lcd_gotoxy(unsigned char x, unsigned char y)
	MOVFF	FSR2L, POSTDEC1
	MOVFF	FSR1L, FSR2L
	MOVFF	r0x00, POSTDEC1
	MOVFF	r0x01, POSTDEC1
	MOVLW	0x02
	MOVFF	PLUSW2, r0x00
	MOVLW	0x03
	MOVFF	PLUSW2, r0x01
	.line	274; fLCD3bSDCC.h	switch(y)
	MOVLW	0x01
	SUBWF	r0x01, W
	BNC	_00212_DS_
	MOVLW	0x05
	SUBWF	r0x01, W
	BC	_00212_DS_
	DECF	r0x01, F
	CLRF	PCLATH
	CLRF	PCLATU
	RLCF	r0x01, W
	RLCF	PCLATH, F
	RLCF	WREG, W
	RLCF	PCLATH, F
	ANDLW	0xfc
	ADDLW	LOW(_00224_DS_)
	MOVWF	POSTDEC1
	MOVLW	HIGH(_00224_DS_)
	ADDWFC	PCLATH, F
	MOVLW	UPPER(_00224_DS_)
	ADDWFC	PCLATU, F
	MOVF	PREINC1, W
	MOVWF	PCL
_00224_DS_:
	GOTO	_00208_DS_
	GOTO	_00209_DS_
	GOTO	_00210_DS_
	GOTO	_00211_DS_
_00208_DS_:
	.line	277; fLCD3bSDCC.h	ADDRESS  = LCD_LINE1;
	MOVLW	0x80
	MOVWF	r0x01
	.line	278; fLCD3bSDCC.h	break;
	BRA	_00213_DS_
_00209_DS_:
	.line	280; fLCD3bSDCC.h	ADDRESS = LCD_LINE2;
	MOVLW	0xc0
	MOVWF	r0x01
	.line	281; fLCD3bSDCC.h	break;
	BRA	_00213_DS_
_00210_DS_:
	.line	283; fLCD3bSDCC.h	ADDRESS = LCD_LINE3;
	MOVLW	0x94
	MOVWF	r0x01
	.line	284; fLCD3bSDCC.h	break;
	BRA	_00213_DS_
_00211_DS_:
	.line	286; fLCD3bSDCC.h	ADDRESS = LCD_LINE4;
	MOVLW	0xd4
	MOVWF	r0x01
	.line	287; fLCD3bSDCC.h	break;
	BRA	_00213_DS_
_00212_DS_:
	.line	289; fLCD3bSDCC.h	ADDRESS = LCD_LINE1;
	MOVLW	0x80
	MOVWF	r0x01
_00213_DS_:
	.line	293; fLCD3bSDCC.h	ADDRESS = (ADDRESS + x) -1;
	MOVF	r0x01, W
	ADDWF	r0x00, F
	DECF	r0x00, W
	MOVWF	r0x01
	.line	294; fLCD3bSDCC.h	lcd_send(LCD_COMMANDMODE, ADDRESS);
	MOVF	r0x01, W
	MOVWF	POSTDEC1
	MOVLW	0x00
	MOVWF	POSTDEC1
	CALL	_lcd_send
	MOVF	POSTINC1, F
	MOVF	POSTINC1, F
	MOVFF	PREINC1, r0x01
	MOVFF	PREINC1, r0x00
	MOVFF	PREINC1, FSR2L
	RETURN	

; ; Starting pCode block
S_lcdTest__lcd_init	code
_lcd_init:
	.line	232; fLCD3bSDCC.h	void lcd_init(void)
	MOVFF	FSR2L, POSTDEC1
	MOVFF	FSR1L, FSR2L
	MOVFF	r0x00, POSTDEC1
	MOVFF	r0x01, POSTDEC1
	MOVFF	r0x02, POSTDEC1
	MOVFF	r0x03, POSTDEC1
	.line	236; fLCD3bSDCC.h	TRIS_E = 0;
	BCF	_TRISAbits, 0
	.line	237; fLCD3bSDCC.h	TRIS_CK = 0;
	BCF	_TRISAbits, 1
	.line	238; fLCD3bSDCC.h	TRIS_DAT= 0;
	BCF	_TRISAbits, 2
	.line	239; fLCD3bSDCC.h	E_PIN = 0;
	BCF	_LATAbits, 0
	.line	241; fLCD3bSDCC.h	delay_ms(10);
	MOVLW	0x00
	MOVWF	POSTDEC1
	MOVLW	0x0a
	MOVWF	POSTDEC1
	CALL	_delay_ms
	MOVF	POSTINC1, F
	MOVF	POSTINC1, F
	.line	244; fLCD3bSDCC.h	for(i=0; i< 3; i++)
	CLRF	r0x00
_00185_DS_:
	.line	246; fLCD3bSDCC.h	lcd_send_quartet(LCD_COMMANDMODE, LCD_RESET);
	MOVLW	0x30
	MOVWF	POSTDEC1
	MOVLW	0x00
	MOVWF	POSTDEC1
	CALL	_lcd_send_quartet
	MOVF	POSTINC1, F
	MOVF	POSTINC1, F
	.line	247; fLCD3bSDCC.h	delay_ms(5);
	MOVLW	0x00
	MOVWF	POSTDEC1
	MOVLW	0x05
	MOVWF	POSTDEC1
	CALL	_delay_ms
	MOVF	POSTINC1, F
	MOVF	POSTINC1, F
	.line	244; fLCD3bSDCC.h	for(i=0; i< 3; i++)
	INCF	r0x00, F
	MOVLW	0x03
	SUBWF	r0x00, W
	BNC	_00185_DS_
	.line	250; fLCD3bSDCC.h	lcd_send_quartet(LCD_COMMANDMODE, LCD_D4_BIT_CONF);
	MOVLW	0x20
	MOVWF	POSTDEC1
	MOVLW	0x00
	MOVWF	POSTDEC1
	CALL	_lcd_send_quartet
	MOVF	POSTINC1, F
	MOVF	POSTINC1, F
	.line	251; fLCD3bSDCC.h	delay_ms(5);
	MOVLW	0x00
	MOVWF	POSTDEC1
	MOVLW	0x05
	MOVWF	POSTDEC1
	CALL	_delay_ms
	MOVF	POSTINC1, F
	MOVF	POSTINC1, F
	.line	253; fLCD3bSDCC.h	for(i=0; i < sizeof(LCD_INIT_STRING); i++)
	CLRF	r0x00
_00187_DS_:
	.line	255; fLCD3bSDCC.h	lcd_send(LCD_COMMANDMODE, LCD_INIT_STRING[i]);
	MOVLW	LOW(_LCD_INIT_STRING)
	ADDWF	r0x00, W
	MOVWF	r0x01
	CLRF	r0x02
	MOVLW	HIGH(_LCD_INIT_STRING)
	ADDWFC	r0x02, F
	CLRF	r0x03
	MOVLW	UPPER(_LCD_INIT_STRING)
	ADDWFC	r0x03, F
	MOVFF	r0x01, TBLPTRL
	MOVFF	r0x02, TBLPTRH
	MOVFF	r0x03, TBLPTRU
	TBLRD*+	
	MOVFF	TABLAT, r0x01
	MOVF	r0x01, W
	MOVWF	POSTDEC1
	MOVLW	0x00
	MOVWF	POSTDEC1
	CALL	_lcd_send
	MOVF	POSTINC1, F
	MOVF	POSTINC1, F
	.line	256; fLCD3bSDCC.h	delay_ms(5);
	MOVLW	0x00
	MOVWF	POSTDEC1
	MOVLW	0x05
	MOVWF	POSTDEC1
	CALL	_delay_ms
	MOVF	POSTINC1, F
	MOVF	POSTINC1, F
	.line	253; fLCD3bSDCC.h	for(i=0; i < sizeof(LCD_INIT_STRING); i++)
	INCF	r0x00, F
	MOVLW	0x05
	SUBWF	r0x00, W
	BNC	_00187_DS_
	MOVFF	PREINC1, r0x03
	MOVFF	PREINC1, r0x02
	MOVFF	PREINC1, r0x01
	MOVFF	PREINC1, r0x00
	MOVFF	PREINC1, FSR2L
	RETURN	

; ; Starting pCode block
S_lcdTest__lcd_send	code
_lcd_send:
	.line	213; fLCD3bSDCC.h	void lcd_send(char mode, char dato)
	MOVFF	FSR2L, POSTDEC1
	MOVFF	FSR1L, FSR2L
	MOVFF	r0x00, POSTDEC1
	MOVFF	r0x01, POSTDEC1
	MOVFF	r0x02, POSTDEC1
	MOVLW	0x02
	MOVFF	PLUSW2, r0x00
	MOVLW	0x03
	MOVFF	PLUSW2, r0x01
	.line	216; fLCD3bSDCC.h	delay_ms(2 );
	MOVLW	0x00
	MOVWF	POSTDEC1
	MOVLW	0x02
	MOVWF	POSTDEC1
	CALL	_delay_ms
	MOVF	POSTINC1, F
	MOVF	POSTINC1, F
	.line	217; fLCD3bSDCC.h	E_PIN = 0;
	BCF	_LATAbits, 0
	.line	220; fLCD3bSDCC.h	temp &= 0xf0;
	MOVLW	0xf0
	ANDWF	r0x01, W
	MOVWF	r0x02
	.line	221; fLCD3bSDCC.h	lcd_send_quartet(mode, temp);
	MOVF	r0x02, W
	MOVWF	POSTDEC1
	MOVF	r0x00, W
	MOVWF	POSTDEC1
	CALL	_lcd_send_quartet
	MOVF	POSTINC1, F
	MOVF	POSTINC1, F
	.line	223; fLCD3bSDCC.h	temp = temp <<4;
	SWAPF	r0x01, W
	ANDLW	0xf0
	MOVWF	r0x02
	.line	224; fLCD3bSDCC.h	temp &=0xf0;
	MOVLW	0xf0
	ANDWF	r0x02, F
	.line	225; fLCD3bSDCC.h	lcd_send_quartet(mode, temp);
	MOVF	r0x02, W
	MOVWF	POSTDEC1
	MOVF	r0x00, W
	MOVWF	POSTDEC1
	CALL	_lcd_send_quartet
	MOVF	POSTINC1, F
	MOVF	POSTINC1, F
	MOVFF	PREINC1, r0x02
	MOVFF	PREINC1, r0x01
	MOVFF	PREINC1, r0x00
	MOVFF	PREINC1, FSR2L
	RETURN	

; ; Starting pCode block
S_lcdTest__lcd_send_quartet	code
_lcd_send_quartet:
	.line	162; fLCD3bSDCC.h	void lcd_send_quartet(char mode, char dato)
	MOVFF	FSR2L, POSTDEC1
	MOVFF	FSR1L, FSR2L
	MOVFF	r0x00, POSTDEC1
	MOVFF	r0x01, POSTDEC1
	MOVFF	r0x02, POSTDEC1
	MOVFF	r0x03, POSTDEC1
	MOVFF	r0x04, POSTDEC1
	MOVLW	0x02
	MOVFF	PLUSW2, r0x00
	MOVLW	0x03
	MOVFF	PLUSW2, r0x01
	.line	171; fLCD3bSDCC.h	if(rs_pin == 1)
	MOVF	r0x00, W
	XORLW	0x01
	BNZ	_00145_DS_
	.line	172; fLCD3bSDCC.h	dato |= 0x08;
	BSF	r0x01, 3
_00145_DS_:
	.line	174; fLCD3bSDCC.h	for(x=0;x<5;x++)
	CLRF	r0x00
_00138_DS_:
	.line	176; fLCD3bSDCC.h	temp = dato;
	MOVFF	r0x01, r0x02
	.line	178; fLCD3bSDCC.h	if(x<4)
	MOVLW	0x04
	SUBWF	r0x00, W
	BC	_00132_DS_
	.line	180; fLCD3bSDCC.h	mask = mask <<(x +4);
	MOVLW	0x04
	ADDWF	r0x00, W
	MOVWF	r0x03
	MOVLW	0x01
	MOVWF	r0x04
	MOVF	r0x03, W
	BZ	_00162_DS_
	NEGF	WREG
	BCF	STATUS, 0
_00163_DS_:
	RLCF	r0x04, F
	ADDLW	0x01
	BNC	_00163_DS_
_00162_DS_:
	.line	181; fLCD3bSDCC.h	mask &= 0xf0;
	MOVLW	0xf0
	ANDWF	r0x04, F
	BRA	_00133_DS_
_00132_DS_:
	.line	185; fLCD3bSDCC.h	mask = 0x08;
	MOVLW	0x08
	MOVWF	r0x04
_00133_DS_:
	.line	188; fLCD3bSDCC.h	temp &= mask;
	MOVF	r0x04, W
	ANDWF	r0x02, F
	.line	189; fLCD3bSDCC.h	if(mask == 0x08) temp = temp >> 3;
	MOVF	r0x04, W
	XORLW	0x08
	BNZ	_00135_DS_
	SWAPF	r0x02, W
	RLNCF	WREG, W
	ANDLW	0x1f
	MOVWF	r0x02
	BRA	_00136_DS_
_00135_DS_:
	.line	190; fLCD3bSDCC.h	else temp = temp >> (x + 4);
	MOVFF	r0x00, r0x03
	CLRF	r0x04
	MOVLW	0x04
	ADDWF	r0x03, F
	BTFSC	STATUS, 0
	INCF	r0x04, F
	MOVF	r0x03, W
	BZ	_00136_DS_
	BN	_00171_DS_
	NEGF	WREG
	BCF	STATUS, 0
_00169_DS_:
	RRCF	r0x02, F
	ADDLW	0x01
	BNC	_00169_DS_
	BRA	_00136_DS_
_00171_DS_:
	BCF	STATUS, 0
_00170_DS_:
	RLCF	r0x02, F
	ADDLW	0x01
	BNC	_00170_DS_
_00136_DS_:
	.line	191; fLCD3bSDCC.h	temp &= 0x01;
	MOVLW	0x01
	ANDWF	r0x02, F
	.line	192; fLCD3bSDCC.h	DAT_PIN = temp;
	MOVF	r0x02, W
	ANDLW	0x01
	RLNCF	WREG, W
	RLNCF	WREG, W
	MOVWF	PRODH
	MOVF	_LATAbits, W
	ANDLW	0xfb
	IORWF	PRODH, W
	MOVWF	_LATAbits
	.line	193; fLCD3bSDCC.h	CK_PIN = 0;
	BCF	_LATAbits, 1
	.line	194; fLCD3bSDCC.h	delay_ms(2);
	MOVLW	0x00
	MOVWF	POSTDEC1
	MOVLW	0x02
	MOVWF	POSTDEC1
	CALL	_delay_ms
	MOVF	POSTINC1, F
	MOVF	POSTINC1, F
	.line	195; fLCD3bSDCC.h	CK_PIN = 1;
	BSF	_LATAbits, 1
	.line	196; fLCD3bSDCC.h	delay_ms(2);
	MOVLW	0x00
	MOVWF	POSTDEC1
	MOVLW	0x02
	MOVWF	POSTDEC1
	CALL	_delay_ms
	MOVF	POSTINC1, F
	MOVF	POSTINC1, F
	.line	174; fLCD3bSDCC.h	for(x=0;x<5;x++)
	INCF	r0x00, F
	MOVLW	0x05
	SUBWF	r0x00, W
	BTFSS	STATUS, 0
	BRA	_00138_DS_
	.line	199; fLCD3bSDCC.h	E_PIN = 1;
	BSF	_LATAbits, 0
	.line	200; fLCD3bSDCC.h	delay_ms(1);
	MOVLW	0x00
	MOVWF	POSTDEC1
	MOVLW	0x01
	MOVWF	POSTDEC1
	CALL	_delay_ms
	MOVF	POSTINC1, F
	MOVF	POSTINC1, F
	.line	201; fLCD3bSDCC.h	E_PIN = 0;
	BCF	_LATAbits, 0
	MOVFF	PREINC1, r0x04
	MOVFF	PREINC1, r0x03
	MOVFF	PREINC1, r0x02
	MOVFF	PREINC1, r0x01
	MOVFF	PREINC1, r0x00
	MOVFF	PREINC1, FSR2L
	RETURN	

; ; Starting pCode block
S_lcdTest__delay_ms	code
_delay_ms:
	.line	61; simple_delay.h	void delay_ms(unsigned int t) {
	MOVFF	FSR2L, POSTDEC1
	MOVFF	FSR1L, FSR2L
	MOVFF	r0x00, POSTDEC1
	MOVFF	r0x01, POSTDEC1
	MOVFF	r0x02, POSTDEC1
	MOVFF	r0x03, POSTDEC1
	MOVLW	0x02
	MOVFF	PLUSW2, r0x00
	MOVLW	0x03
	MOVFF	PLUSW2, r0x01
_00121_DS_:
	.line	62; simple_delay.h	while(t--) {
	MOVFF	r0x00, r0x02
	MOVFF	r0x01, r0x03
	MOVLW	0xff
	ADDWF	r0x00, F
	ADDWFC	r0x01, F
	MOVF	r0x02, W
	IORWF	r0x03, W
	BZ	_00124_DS_
	.line	63; simple_delay.h	delay1ktcy(__DELAY_CLOCK__ );
	MOVLW	0x0c
	CALL	_delay1ktcy
	BRA	_00121_DS_
_00124_DS_:
	MOVFF	PREINC1, r0x03
	MOVFF	PREINC1, r0x02
	MOVFF	PREINC1, r0x01
	MOVFF	PREINC1, r0x00
	MOVFF	PREINC1, FSR2L
	RETURN	

; ; Starting pCode block
S_lcdTest__delay_us	code
_delay_us:
	.line	54; simple_delay.h	void delay_us(unsigned int t) {
	MOVFF	FSR2L, POSTDEC1
	MOVFF	FSR1L, FSR2L
	MOVFF	r0x00, POSTDEC1
	MOVFF	r0x01, POSTDEC1
	MOVFF	r0x02, POSTDEC1
	MOVFF	r0x03, POSTDEC1
	MOVLW	0x02
	MOVFF	PLUSW2, r0x00
	MOVLW	0x03
	MOVFF	PLUSW2, r0x01
	.line	55; simple_delay.h	t = t >> 2;
	BCF	STATUS, 0
	RRCF	r0x01, F
	RRCF	r0x00, F
	BCF	STATUS, 0
	RRCF	r0x01, F
	RRCF	r0x00, F
_00113_DS_:
	.line	56; simple_delay.h	while(t--) {
	MOVFF	r0x00, r0x02
	MOVFF	r0x01, r0x03
	MOVLW	0xff
	ADDWF	r0x00, F
	ADDWFC	r0x01, F
	MOVF	r0x02, W
	IORWF	r0x03, W
	BZ	_00116_DS_
	.line	57; simple_delay.h	delay10tcy(__DELAY_CLOCK2__);
	MOVLW	0x03
	CALL	_delay10tcy
	BRA	_00113_DS_
_00116_DS_:
	MOVFF	PREINC1, r0x03
	MOVFF	PREINC1, r0x02
	MOVFF	PREINC1, r0x01
	MOVFF	PREINC1, r0x00
	MOVFF	PREINC1, FSR2L
	RETURN	

; ; Starting pCode block
S_lcdTest__delay_cycles	code
_delay_cycles:
	.line	47; simple_delay.h	void delay_cycles(unsigned int t) {
	MOVFF	FSR2L, POSTDEC1
	MOVFF	FSR1L, FSR2L
	MOVFF	r0x00, POSTDEC1
	MOVFF	r0x01, POSTDEC1
	MOVFF	r0x02, POSTDEC1
	MOVFF	r0x03, POSTDEC1
	MOVLW	0x02
	MOVFF	PLUSW2, r0x00
	MOVLW	0x03
	MOVFF	PLUSW2, r0x01
_00105_DS_:
	.line	48; simple_delay.h	while(t--) {
	MOVFF	r0x00, r0x02
	MOVFF	r0x01, r0x03
	MOVLW	0xff
	ADDWF	r0x00, F
	ADDWFC	r0x01, F
	MOVF	r0x02, W
	IORWF	r0x03, W
	BZ	_00108_DS_
	nop
	
	BRA	_00105_DS_
_00108_DS_:
	MOVFF	PREINC1, r0x03
	MOVFF	PREINC1, r0x02
	MOVFF	PREINC1, r0x01
	MOVFF	PREINC1, r0x00
	MOVFF	PREINC1, FSR2L
	RETURN	

; ; Starting pCode block for Ival
	code
_LCD_INIT_STRING:
	DB	0x28, 0x01, 0x0c, 0x06, 0x0c
; ; Starting pCode block
__str_0:
	DB	0x20, 0x20, 0x41, 0x75, 0x74, 0x6f, 0x6d, 0x61, 0x74, 0x69, 0x73, 0x6d
	DB	0x6f, 0x20, 0x70, 0x61, 0x72, 0x61, 0x20, 0x20, 0x00
; ; Starting pCode block
__str_1:
	DB	0x20, 0x20, 0x20, 0x6d, 0x65, 0x64, 0x69, 0x63, 0x69, 0x6f, 0x6e, 0x20
	DB	0x65, 0x6e, 0x20, 0x69, 0x6e, 0x76, 0x2e, 0x20, 0x00
; ; Starting pCode block
__str_2:
	DB	0x20, 0x20, 0x20, 0x70, 0x61, 0x6c, 0x65, 0x6f, 0x2d, 0x61, 0x6d, 0x62
	DB	0x69, 0x65, 0x6e, 0x74, 0x61, 0x6c, 0x20, 0x2e, 0x00
; ; Starting pCode block
__str_3:
	DB	0x20, 0x20, 0x20, 0x49, 0x47, 0x4c, 0x20, 0x55, 0x4e, 0x41, 0x4d, 0x20
	DB	0x2d, 0x20, 0x49, 0x54, 0x53, 0x54, 0x20, 0x20, 0x00


; Statistics:
; code size:	 1696 (0x06a0) bytes ( 1.29%)
;           	  848 (0x0350) words
; udata size:	    0 (0x0000) bytes ( 0.00%)
; access size:	    5 (0x0005) bytes


	end
